package org.scirp.ijmis.dao.common.impl;

import java.util.List;

import org.scirp.ijmis.dao.base.impl.BaseDAOImpl;
import org.scirp.ijmis.dao.common.ICountryDAO;
import org.scirp.ijmis.po.common.Country;

public class CountryDAOImpl extends BaseDAOImpl<Country> implements ICountryDAO {

	private static final String className = CountryDAOImpl.class.toString();

	// public List<Country> selectAll() {
	//		
	// String hql="from Country order by pid asc" ;
	// return super.ExecuteQuery(hql, className+"-->selectAll");
	// }

	public List<Country> selectAll() {

		String hql = "from Country where pid not in(0,9999) order by country asc";
		List<Country> list = super.ExecuteQuery(hql, className + "-->selectAll");
		Country c = new Country();
		c.setCountry("-Select one-");
		c.setPid(0L);
		list.add(0, c);
		Country co = new Country();
		co.setCountry("other");
		co.setPid(9999L);
		list.add(co);
		return list;
	}

	public Long countObject() {
		return super.countObject(className + "-->selectAll");
	}

	public Country selectById(Object id) {

		return (Country) super.selectById(id, className + "-->selectById");
	}

}
